From: Philip Withnall Date: Wed, 30 May 2018 11:00:22 +0000 (+0100) Subject: lib/repo-pull: Add some missing assertions for progress statistics X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~23^2~12 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=78f40136dbf8411a66ce3f6d8263d8e72d951163;p=ostree.git lib/repo-pull: Add some missing assertions for progress statistics Various of the counters already have assertions like this; add some more for total paranoia. Signed-off-by: Philip Withnall Closes: #1594 Approved by: jlebon --- diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 668968e6..83ccff5c 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -1119,6 +1119,7 @@ content_fetch_on_complete (GObject *object, } out: + g_assert (pull_data->n_outstanding_content_fetches > 0); pull_data->n_outstanding_content_fetches--; if (_ostree_fetcher_should_retry_request (local_error, fetch_data->n_retries_remaining--)) @@ -1168,6 +1169,7 @@ on_metadata_written (GObject *object, queue_scan_one_metadata_object_c (pull_data, csum, objtype, fetch_data->path, 0, fetch_data->requested_ref); out: + g_assert (pull_data->n_outstanding_metadata_write_requests > 0); pull_data->n_outstanding_metadata_write_requests--; fetch_object_data_free (fetch_data);